{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "讲师： 沈福利\n",
    "\n",
    "本章节目标\n",
    "\n",
    "1. 绘制一个简单的饼状图\n",
    "2. 统计不同的embarked 对应的幸存的人数"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 饼状图"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "大小与总和之间的比例关系。matplotlib 中可以通过pie函数来完成\n",
    "\n",
    "\n",
    "在matplotlib 中，plt.pie(x,labels = None) \n",
    "\n",
    "x 表示饼状图的数据;labels 添加标签"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 导入库"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import matplotlib.pyplot as plt\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "# 设置字体大小和图表的大小\n",
    "plt.rc('figure',figsize = (12,9))\n",
    "plt.rc('font',size = 15)\n",
    "# 中文乱码问题\n",
    "from matplotlib.font_manager import _rebuild\n",
    "_rebuild()\n",
    "plt.rcParams['font.sans-serif']=[u'SimHei']\n",
    "plt.rcParams['axes.unicode_minus']=False"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 绘制一个简单的图表"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "这里我们设置labels 数组，分别代表 高中、本科、硕士、博士活着其他的学历，nums 代码学历对应的人数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "nums length =  5\n",
      "labels length =  5\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAQYAAADuCAYAAADbValnAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF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5IAZMPvNgfB//eaA0Wf0m33mQKA50CWD0o31wTtcNOawWO3CEoJtQKO/xt83ln+zaISFwQm8grXoqwEPYC1YPg1cCZwNnCul/KoQ4mrgfimleeyMQQhxK7BBSnmXEOJ14NLwv+l94esbYmm73eh2G6A4mnBRmLeBt6tKnT5gPnAG1jfeqAh/0BrCj+fC0YspWDOJaVh1JaYBhVgfIBMQMii1gX0D5sC+gQGgN3zcxBKPw88F4MD6G9LDzx1YH3oZPuYEvFjrJ9uxhKAJK+mrKdZCEIX1wHVYbQE+BHwq/MjFEqongXOFEI8Db0oZtW9pKbBUCHEd1qzj8PrP39NNFEAJQ1ITLkj7GseUbhsr4UW7A+HHEXwVPgFkYk2T87A+NFlY6xUZWDOWw/938d46Rs+gRxeWuzKANQPpxhKADptzC94GfgncCJwCPIXlOhwW2rOwPtyvCiFeEULcK6XcjjWTygQIu1X1wGNSyhfD4tAO5GO9z7RDCYOCcA5Ad/ixx2ZzYs0uYCvW+sUM4HvAF7BmNdOxZlP3CiHcWJvfDheBfRi4SwhxE/AJ4KfAnUKIn2C5PvcCJyTubSQWtcagUCiGoAq1KBSKIShhUCgUQ1DCoFAohqCEQaFQDEEJg0KhGIISBoVCMQQlDAqFYghKGBQKxRCUMCgUiiEoYVAoFENQwqBQKIaghEGhUAxBCYNCoRiCEgaFQjEEJQwKhWIIShgUCsUQlDAoFIohKGFQKBRDUMKgUCiGoIRBoVAMQQmDQqEYghIGhUIxBCUMCoViCEoYFArFEJQwKBSKIShhUCgUQ1DCoFAohqCEQaFQDOH/Ayo67k3De6lZAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "nums = [25,37,33,37,6]\n",
    "labels = ['High',\"Bachelor\",'Master','Ph.d','Others']\n",
    "\n",
    "\n",
    "print(\"nums length = \",len(nums))\n",
    "print(\"labels length = \",len(labels))\n",
    "\n",
    "explode = [0,0.1,0,0,0] # 0.1 凸出显示这个部分\n",
    "\n",
    "# 绘制图表\n",
    "plt.axes(aspect = 1) # 设置圆形\n",
    "fig = plt.pie(x = nums,# 数据\n",
    "              labels=labels,# 标签\n",
    "              explode=explode,\n",
    "              autopct='%3.1f %%',\n",
    "              shadow=True,# 是否有阴影\n",
    "              labeldistance=1.1,# 文本中位置离远点的距离 1.1 指1.1 倍半径的位置\n",
    "              startangle=90,# 起始的角度\n",
    "              pctdistance=0.6)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 统计不同的embarked 对应的幸存的人数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>survived</th>\n",
       "      <th>pclass</th>\n",
       "      <th>sex</th>\n",
       "      <th>age</th>\n",
       "      <th>sibsp</th>\n",
       "      <th>parch</th>\n",
       "      <th>fare</th>\n",
       "      <th>embarked</th>\n",
       "      <th>class</th>\n",
       "      <th>who</th>\n",
       "      <th>adult_male</th>\n",
       "      <th>deck</th>\n",
       "      <th>embark_town</th>\n",
       "      <th>alive</th>\n",
       "      <th>alone</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>22.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>7.2500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>no</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>38.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>71.2833</td>\n",
       "      <td>C</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>C</td>\n",
       "      <td>Cherbourg</td>\n",
       "      <td>yes</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>female</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>7.9250</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>yes</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>female</td>\n",
       "      <td>35.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>53.1000</td>\n",
       "      <td>S</td>\n",
       "      <td>First</td>\n",
       "      <td>woman</td>\n",
       "      <td>False</td>\n",
       "      <td>C</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>yes</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>male</td>\n",
       "      <td>35.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>8.0500</td>\n",
       "      <td>S</td>\n",
       "      <td>Third</td>\n",
       "      <td>man</td>\n",
       "      <td>True</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Southampton</td>\n",
       "      <td>no</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   survived  pclass     sex   age  sibsp  parch     fare embarked  class  \\\n",
       "0         0       3    male  22.0      1      0   7.2500        S  Third   \n",
       "1         1       1  female  38.0      1      0  71.2833        C  First   \n",
       "2         1       3  female  26.0      0      0   7.9250        S  Third   \n",
       "3         1       1  female  35.0      1      0  53.1000        S  First   \n",
       "4         0       3    male  35.0      0      0   8.0500        S  Third   \n",
       "\n",
       "     who  adult_male deck  embark_town alive  alone  \n",
       "0    man        True  NaN  Southampton    no  False  \n",
       "1  woman       False    C    Cherbourg   yes  False  \n",
       "2  woman       False  NaN  Southampton   yes   True  \n",
       "3  woman       False    C  Southampton   yes  False  \n",
       "4    man        True  NaN  Southampton    no   True  "
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "titanic = pd.read_csv('data/titanic.csv',index_col=0)\n",
    "titanic.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['C', 'Q', 'S'], dtype=object)"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x_data_embarked = np.unique(titanic['embarked'].dropna())\n",
    "x_data_embarked"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "embarked\n",
       "C     93\n",
       "Q     30\n",
       "S    217\n",
       "Name: survived, dtype: int64"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "labels = []\n",
    "y_data_embarked = titanic.groupby(by = 'embarked')['survived'].sum()\n",
    "y_data_embarked"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAO4AAADuCAYAAAA+7jsiAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAIABJREFUeJzt3Xl8VOW9x/HPM3smyWQPO0QgQS8eNIoEUauIS62Vaje73nS5tnpvt1tby22tvdVXa9tb7WKXq16rc1trbeutRm3rViwiAi4oUTBAIGDYAtkmmSSznef+MYNSzE5mzpzJ7+1rXiA5mfMj5JtzznN+53mU1hohhL04rC5ACDF2ElwhbEiCK4QNSXCFsCEJrhA2JMEVwoYkuELYkARXCBuS4AphQxJcIWxIgiuEDUlwhbAhCa4QNiTBFcKGJLhC2JAEVwgbkuAKYUMSXCFsSIIrhA1JcIWwIQmuEDYkwRXChiS4QtiQBFcIG5LgCmFDElwhbEiCK4QNSXCFsCEJrhA2JMEVwoZcVhcgjk/VqkdLgZnAdKCA5L+pO/XrhpbvXbrFwvJEmkhws1zVqkenA6cDc0gGdCYw46hf84b59M8DEtwcJMHNIlWrHvWRDOlSYKnWeqlSaqbFZYksJMG1UNWqR4uBS4BlWuulwClKKfeRjyulLKtNZDcJboalwnq5NhNXohwrjgTVipAaQePbwBIgCsRSv0aBA0BL6rUL2N1Y3ziQ8QLFkCS4GXBUWD+EcpyvlHIrh9OyegK1gYVA2cyrZp7vzHeePYpP0UbQOEgyxC28FegdwMbG+sZwumoVg5PgpknVqke9wAe0mfhYNoT1GNcAhfFQfI4zf1Q1KWBq6nXmMR+LGUHjeeBvwGpgnRyd00+CO8GqVj06RcejX8Th/KxyOEuzKKzHekO5VN8EvI8bWJZ6XQ9EjKDxHG8FeUNjfWNsAvYjjiLBnSBVqx5daMYGvqVcniuUyzOZv65e4L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NrrTVmxOxOhBOH493xAwN7BlrCW8MdZsQ8ElQT2Aq8CDQD++ToOrEkuFkotUDZLOAEkt1Z1STvDSugl+Rp9ZvzAruKXX5PuafIVeIqcgVcRc4CZ5HT7yxy5jmLHD5HkXKrgrEepXVcR8yI2Z0YSITMPrM70ZcIxbpiHdG26OHI3ki7OWB6gOJUXQAtwAvANmCPNEuklwTXBlLdWTNJPlZ4CrCA5BKpmrcmtY+kXgOpX9/8h1Vu5XSXuQuUQzm0qTWp/478/s0/M9Faa61jOmEOmAnAm3r5AA/JI+mRnwAHgFeALcCu0KZQOL1fBXE0Ca4NpQa4yoAAyRHqEmAaydPtSpJT7kAyvOqo34+Wg2RIO0j2YO8H9pAcCT4MdNh9JQC7k+DmoNQqDQUkQ13EW0fn0bzCJK+pe+WeavaS4AphQ5N10S8hbE2CK4QNSXCFsCEJrhA2JMEVwoYkuELYkARXCBuS4AphQxJcIWxIgiuEDUlwhbAhCa4QNiTBFcKGJLhC2JAEVwgbkuAKYUMSXCFsSIIrhA1JcIWwIQmuEDYkwRXChiS4QtiQBFcIG5LgCmFDElwhbOj/AQYJXRGoHtLzAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 绘制图表\n",
    "plt.axes(aspect = 1) # 设置圆形\n",
    "fig = plt.pie(x = y_data_embarked,# 数据\n",
    "              labels=x_data_embarked,# 标签\n",
    "              explode=[0,0,0.1],\n",
    "              autopct='%3.1f %%',\n",
    "              shadow=True,# 是否有阴影\n",
    "              labeldistance=1.1,# 文本中位置离远点的距离 1.1 指1.1 倍半径的位置\n",
    "              startangle=90,# 起始的角度\n",
    "              pctdistance=0.6)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.2"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
